Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

d3-array

Package Overview
Dependencies
Maintainers
2
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

d3-array

Array manipulation, ordering, searching, summarizing, etc.

  • 2.12.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4.5M
decreased by-55.38%
Maintainers
2
Weekly downloads
 
Created

What is d3-array?

The d3-array package is a JavaScript library that provides powerful data manipulation and analysis functions. It is part of the D3 (Data-Driven Documents) suite of tools, which are used for handling and visualizing data on the web. d3-array includes methods for statistics, searching, sorting, transforming, and more.

What are d3-array's main functionalities?

Statistics

Calculate statistical measures such as mean, median, min, max, sum, variance, and standard deviation.

const d3 = require('d3-array');
const data = [1, 2, 3, 4, 5];
const mean = d3.mean(data);

Searching

Search for a value in a sorted array using binary search, such as bisectLeft and bisectRight.

const d3 = require('d3-array');
const data = [1, 2, 3, 4, 5];
const index = d3.bisectLeft(data, 3);

Sorting

Sort data using natural or custom comparators.

const d3 = require('d3-array');
const data = [{name: 'Alice', age: 40}, {name: 'Bob', age: 30}];
const sortedData = data.sort(d3.comparator((a, b) => a.age - b.age));

Transforming

Transform data using methods like rollup and group to aggregate and organize data.

const d3 = require('d3-array');
const data = [1, 2, 3, 4, 5];
const rolledUp = d3.rollup(data, v => v.length, d => d);

Histogram

Generate histograms to bin data into discrete intervals.

const d3 = require('d3-array');
const data = [1, 2, 3, 4, 5];
const histogram = d3.histogram().thresholds(5)(data);

Other packages similar to d3-array

Keywords

FAQs

Package last updated on 24 Mar 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc